/*
 * Copyright 2011 Shotaro Uchida <fantom@xmaker.mx>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jazzkaffe.zcl;

import org.jazzkaffe.ZigBeeDataPacket;

/**
 *
 * @author Shotaro Uchida <fantom@xmaker.mx>
 */
public interface ZCLCommandPacket extends ZigBeeDataPacket {
    
    public final static byte CMD_READ_ATTRIBUTES = 0x00;
    public final static byte CMD_READ_ATTRIBUTES_RSP = 0x01;
    public final static byte CMD_WRITE_ATTRIBUTES = 0x02;
    public final static byte CMD_WRITE_ATTRIBUTES_UNDIVIDED = 0x03;
    public final static byte CMD_WRITE_ATTRIBUTES_RSP = 0x04;
    public final static byte CMD_WRITE_ATTRIBUTES_NO_RSP = 0x05;
    public final static byte CMD_CONFIGURE_REPORTING = 0x06;
    public final static byte CMD_CONFIGURE_REPORTING_RSP = 0x07;
    public final static byte CMD_READ_REPORTING_CONFIGURATION = 0x08;
    public final static byte CMD_READ_REPORTING_CONFIGURATION_RSP = 0x09;
    public final static byte CMD_REPORT_ATTRIBUTES = 0x0A;
    public final static byte CMD_DEFAULT_RSP = 0x0B;
    public final static byte CMD_DISCOVER_ATTRIBUTES = 0x0C;
    public final static byte CMD_DISCOVER_ATTRIBUTES_RSP = 0x0D;
    public final static byte CMD_READ_ATTRIBUTES_STRUCTURED = 0x0E;
    public final static byte CMD_WRITE_ATTRIBUTES_STRUCTURED = 0x0F;
    public final static byte CMD_WRITE_ATTRIBUTES_STRUCTURED_RSP = 0x10;
    
    public byte getCommandId();
    
    public short getManufacturerCode();
    
    public boolean isManufacturerSpecific();
    
    public boolean isClusterSpecific();
    
    public boolean isFromServer();
    
    public boolean isDisableDefaultResponse();
    
    public int getTsn();
    
    public byte[] getPayload();
    
    public int getPayloadLength();
    
    public int getPayloadOffset();
    
    public void setCommandId(byte commandId);
    
    public void setManufacturerCode(short manufacturerCode);
    
    public void setManufacturerSpecific(boolean manufacturerSpecific);
    
    public void setClusterSpecific(boolean clusterSpecific);

    public void setFromServer(boolean fromServer);

    public void setDisableDefaultResponse(boolean disableDefaultResponse);

    public void setTsn(int tsn);
    
    public void setPayload(byte[] data);
    
    public void setPayload(byte[] data, int offset, int length);
}
